package com.ruoyi.web.controller.report;

import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.date.DateFormater;
import com.ruoyi.fundGraph.domain.FundGraphT;
import com.ruoyi.fundGraph.service.IFundGraphTService;
import com.ruoyi.purposeChart.domain.PurposeChartT;
import com.ruoyi.purposeChart.service.IPurposeChartTService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 返还Controller
 * 
 * @author lijie
 * @date 2023-05-04
 */
@RestController
@RequestMapping("/report/fundGraph")
public class FundGraphTController extends BaseController
{
    @Autowired
    private IFundGraphTService fundGraphTService;

    /**
     * 查询返还列表
     */
    @GetMapping("/monthList")
    public TableDataInfo monthList(FundGraphT fundGraphT)
    {

        startPage();
        if(fundGraphT.getStartDate()==null&&fundGraphT.getEndDate()==null){
            fundGraphT.setStartDate(DateFormater.dateFormat(DateFormater.getSystemCurrentDateYYYYMM(),13)+"01");
            fundGraphT.setEndDate(DateFormater.getSystemCurrentDateYYYYMM()+"01");
        }
        List<FundGraphT> list = fundGraphTService.selectFundGraphTList(fundGraphT);
        return getDataTable(list);
    }

    @GetMapping("/dayList")
    public TableDataInfo dayList(FundGraphT fundGraphT)
    {

        startPage();
        if(fundGraphT.getStartDate()==null&&fundGraphT.getEndDate()==null){
            fundGraphT.setStartDate(DateFormater.dateFormat(DateFormater.getSystemCurrentDateYYYYMM(),13)+"01");
            fundGraphT.setEndDate(DateFormater.getSystemCurrentDateYYYYMM()+"01");
        }
        List<FundGraphT> list = fundGraphTService.selectFundGraphDayTList(fundGraphT);
        return getDataTable(list);
    }

}
